<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>企业中心agin</title>
<link rel="shortcut icon" href="image/icon.png" >
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="js/jquery-3.1.1.min.js"></script>
<!-- Vue.js插件。 -->
<script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="css/qiye.css">
<!-- layui -->
<link rel="stylesheet" href="css/layui.css" />
<script src="js/layui.js"></script>
<script type="text/javascript" src="js/qiye.js"></script>
<script type="text/javascript" src="js/jquery.ztree.core.js"></script>
<link rel="stylesheet" href="zTreeStyle/zTreeStyle.css">
</head>
<body>
<div class="top">
	<div class="topleft">家事无忧公司管理系统</div>
	<div class="topright">
		<div class="comname">name</div>
		<div class="exit">EXIT</div>
	</div>
</div>
<div class="left">
	<div class="onjob">在职员工管理</div>
	<div class="price">员工价值评定</div>
	<div class="record">员工工作记录</div>
	<div class="leave">更多功能</div>
	<!--<div class="Customerservice">公司客服中心</div>-->
	<section class="shift"></section>
	<span style="position: absolute;bottom: 10px; color:white;width:100%;text-align: center;">copy by 家事无忧<br>2018</span>
</div>
<div class="right">
	<div class="right-padding-cominfo">
		
		<table class="layui-hide" id="comuser" lay-filter="comuser"></table>
		
		<script type="text/html" id="xintai">
          <div class="layui-btn-container">
          <button class="layui-btn layui-btn-sm" style="float:right;" lay-event="getexport" id="getexport">导出数据</button>
         </div>
	    </script>
		
		<script type="text/html" id="barDemo">
          <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
	    </script>
<!--           <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a> -->
<!--           <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> -->
	</div>
	<div class="right-padding-money">
		<div style="width: 252px; height: 886px; background: #e3e3e3; border-left:1px solid #c5c5c5;">
			<div style="float: left;width: 10%;">
				<ul id="tree" class="ztree" style="width:260px; overflow:auto;"></ul>
			</div>
		</div>
	</div>
	<div class="right-padding-log">
		<form class="layui-form">
			<div class="layui-form-item">
			    <label class="layui-form-label" style="padding: 9px 0px;text-align:center;width:180px;">选择员工以查看工作记录</label>
			    <div id="big" class="layui-input-inline">
			      <select name="inid" lay-verify="required" id="inid" lay-filter="select01" onchange="alert('选择已经更改！')"> 
			        <option value="" disabled="disabled">请选择</option>
			      </select>
			    </div>
		    </div>
		</form>
		
		<table class="layui-hide"  id="inemp" lay-filter="inemp"></table>
		
	</div>
	<div class="right-padding-rate">
		<h1>敬请期待！</h1>
	</div>
	<div class="right-padding-cs">
		5
	</div>
</div>
  <SCRIPT type="text/javascript">
    var zTree;
    var demoIframe=$("#frame1");

    var setting = {
      view: {
        dblClickExpand: false,
        showLine: true,
        selectedMulti: false
      },
      data: {
    	//是否使用简单模式的ztree
        simpleData: {
          enable: true,
          idKey: "id",
          pIdKey: "fid",
          rootPId: "0"
        }
      },
      callback: {	
        beforeClick: function (treeId, treeNode) {
          var zTree = $.fn.zTree.getZTreeObj("tree");
          if (treeNode.isParent) {
            zTree.expandNode(treeNode);
            return false;
          } else {
            demoIframe.attr("src", treeNode.url);
            return true;
          }
        }
      }
    };

    
    
    $(document).ready(function () {
     var zNodes = [
    	      {id: "1", fid: 0, name: "基本功能 演示"},
    	      {id: 101, fid: "1", name: "最简单的树 --  标准 JSON 数据", file: "core/standardData"},
    	      {id: 102, fid: "1", name: "最简单的树 --  简单 JSON 数据", file: "core/simpleData"}];
//       $.ajax({
//     	  async:false,
//     	  url:"/JWSgeren/getusergrant",
//     	  type:"post",
//     	  success:function(data){
//     		  console.log(data.data);
//     		  zNodes=JSON.parse(data);
//     	  }
//       });
      
      
      $.post("/JWSgeren/getusergrant",function(data){
    	  console.log(data.data);
		  zNodes=JSON.parse(data);
      })
//       zNodes=[
//        {"FID":0,"fid":0,"name":"超级管理员","USERNAME":"liang","MNAME":"所有后台","mname":"所有后台","ID":1,"id":1,"username":"liang","NAME":"超级管理员"},
//        //{"FID":3,"fid":3,"name":"超级管理员","USERNAME":"QWER","MNAME":"所有后台","mname":"所有后台","ID":2,"id":2,"username":"QWER","NAME":"超级管理员"},
//        {"FID":1,"fid":1,"name":"管理员","USERNAME":"244080186","MNAME":"一般数据","mname":"一般数据","ID":3,"id":3,"username":"244080186","NAME":"管理员"},
//        {"FID":1,"fid":1,"name":"管理员","USERNAME":"BAT@163.com","MNAME":"一般数据","mname":"一般数据","ID":4,"id":4,"username":"BAT@163.com","NAME":"管理员"},
//        {"FID":3,"fid":3,"name":"用户","USERNAME":"789","MNAME":"仅自己","mname":"仅自己","ID":5,"id":5,"username":"789","NAME":"用户"},
//        {"FID":3,"fid":3,"name":"用户","USERNAME":"123","MNAME":"仅自己","mname":"仅自己","ID":6,"id":6,"username":"123","NAME":"用户"},
//        {"FID":4,"fid":4,"name":"用户","USERNAME":"liang","MNAME":"仅自己","mname":"仅自己","ID":7,"id":7,"username":"liang","NAME":"用户"},
//        {"FID":4,"fid":4,"name":"用户","USERNAME":"QWER","MNAME":"仅自己","mname":"仅自己","ID":8,"id":8,"username":"QWER","NAME":"用户"}]
      var t = $("#tree");
      var c=$.fn.zTree.init(t, setting, zNodes);
      //document.write(JSON.stringify(zNodes));
    });

  
  </SCRIPT>
</body>
</html>